
use nat_BLA_data_1945_2020, clear

tsset code year

*Copy available 
egen copyavailable_tot = rowtotal(copyavailable?)

by code: gen copyavailable_totsum = sum(copyavailable_tot)

gen copyshare_totsum = copyavailable_totsum/bla_totsum



*2) Map of countries with BLAs
	
	preserve
	
	use oldworlddb_plus, clear
	drop if COWEYEAR<2015
	destring COWCODE, gen(code)
	
	tempfile mapcodes
	save `mapcodes'
	
	restore
	
	preserve
	
	keep if year==2020
	merge 1:1 code using `mapcodes'
	
	#delimit;
	spmap bla_totsum using oldworldcoord_plus, 
		polygon(d(worldcoord) select(keep if _ID==59))
		id(_ID) clm(custom) clb(0 0.9 1 2 5 10 50 1000000)
		fcolor(white gs13 gs11 gs9 gs7 gs5 gs3) 
		legtitle("Total BLAs") title("") name(tot_blas_map, replace)
		legend(label(2 "0") label(3 "1") label(4 "2") label(5 "3-5") label(6 "6-10") 
		label(7 "11-50") label(8 ">50") pos(9) symy(5) symx(5) textw(10) size(3));
		
	#delimit cr
	

	restore
